﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TruckingMobile.ServiceReference1;

namespace TruckingMobile.Controllers
{
    public class HomeController : Controller
    {
        Service1Client client = new Service1Client();
        public string email { get; set; }

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
            return View();
        }

        public ActionResult About(string _email)
        {
            ViewBag.Message = "Your app description page.";

            // Get user information
            var accountInfo = client.AccountInformation(_email);

            ViewBag.Orders = client.GetOrders(int.Parse(accountInfo["Company"]));
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
